
	<div class="adminrectangle"><h2><?php echo $title; ?></h2></div>
	<div class="grid_12"><h5>Below is a list of the stages.</h5></div>
  	<p>
      <a href="<?php echo site_url('admin/create_stage');?>" class="button add"><span class="icon icon1"></span><span class="label"><?php echo lang('create_new_stage');?></span></a>
      <a href="<?php echo site_url('admin/delete_all_results');?>" class="button negative"><span class="icon icon3"></span><span class="label"><?php echo lang('delete_all_results');?></span></a>
    </p>
    <div class='clear'></div>
      <?php if ($this->session->flashdata('message')) { ?>
      <div class="infoMessage"><?php echo $this->session->flashdata('message');?></div>
      <?php } ?>
      <?php
      if(isset($help_message_text))
      {
        if($help_message_text !="")
        {
      ?>
          <div id="helpMessage" title="<?php echo lang($help_message_title);?>"><?php echo lang($help_message_text);?></div>
      <?php
        }
      }
      ?>
  <div class="grid_12 alpha omega">
    <table class="stripeMe">
      <tr>
        <th colspan='2'>Type</th><th>Date</th><th>From - To</th><th><?php echo lang('distance'); ?></th><th colspan='2'></th><th>Started</th>
      </tr>
      <?php
        foreach($stages as $stage)
        {
      ?>
        <tr>
          <td><?php echo $stage->stage_id; ?></td>
          <td><?php echo lang($stage->stage_type); ?></td>
          <td><?php echo mdate( '%d-%m-%Y',mysql_to_unix($stage->stage_date)); ?></td>
          <td><?php echo $stage->stage_depart; ?> - <?php echo $stage->stage_arrive; ?></td>
          <td><?php echo $stage->stage_distance; ?>&nbsp;km</td>
          <td>
            <?php echo anchor('admin/edit_stage/'.$stage->stage_id, lang('edit_stage')); ?><br />
            <?php echo anchor('admin/delete_stage/'.$stage->stage_id, lang('delete_stage'), "class='negative'"); ?>
          </td>
          <td>
            <?php echo anchor('admin/edit_result/'.$stage->stage_id, lang('edit_result')); ?>
          </td>
          <td><?php echo stage_started($stage->stage_id);?></td>
        </tr>  
          
      <?php    
        }
      ?>
    </table>
  </div>  

